
from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class XiaChuFangPage(Base):

    soushoukuang = 'new UiSelector().text("搜索菜谱")'
    shurukuang = (By.ID,'com.xiachufang:id/search_edit_text')
    anniu =  (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[3]/android.widget.TextView')
    duanyan = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.TextView[2]')

    def soushuoyewu(self,neirong):
        self.find_ele(self.soushoukuang).click()
        sleep(2)
        self.find_ele(self.shurukuang).send_keys(neirong)
        sleep(2)
        self.find_ele(self.anniu).click()
        sleep(2)